<template>
  <el-card class="box-card" style="width: 1180px">
    <div class="search">
      <el-row gutter="20">
        
        <el-col :span="6">
          <el-input
            size="medium"
            placeholder="请输入支付方式"
            v-model="query.ptType"
          >
          </el-input>
        </el-col>

        <el-col :span="2">
          <el-button type="primary" size="medium" @click="loadCarMessage()"
            >查询</el-button
          >
        </el-col>

        <el-col :span="2">
          <el-button type="info" size="medium" @click="reset()">重置</el-button>
        </el-col>

         <el-col :span="8">
          <el-button type="info" size="medium" @click="goback()">返回</el-button>
        </el-col>
      </el-row>
    </div>

    <!--表格-->
    <el-table :data="carOrderMessageList" stripe style="width: 100%">
      <el-table-column prop="oiNo" label="订单编号"> </el-table-column>

      <el-table-column prop="payingTime" label="支付时间"> </el-table-column>

      <el-table-column prop="carLicensePlate" label="车牌号"> </el-table-column>

      <el-table-column prop="oiAmount" label="订单金额"> </el-table-column>

      <el-table-column prop="ptType" label="支付方式"> </el-table-column>

      <el-table-column prop="orderStatus" label="订单状态"> </el-table-column>

      
    </el-table>
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="query.pageIndex"
      :page-sizes="pageInfo.pageSizes"
      :page-size="query.pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="pageInfo.total"
    >
    </el-pagination>
  </el-card>
</template>

<script>
export default {
  name: "Admin",
  data() {
    return {
      carOrderMessageList: [],
      pageInfo: {
        pageSizes: [5, 10, 20, 50],
        total: "",
        pages: "",
        
      },
      //封装的请求参数
      query: {
        pageIndex: 1,
        pageSize: 5,
        ptType:"",
      },

      
    };
  },
  methods: {
    //重置按钮
    reset() {
      (this.query.ptType = ""),
        this.loadCarOrderMessage();
    },

    //当每页显示条数改变时
    handleSizeChange(size) {
      this.query.pageSize = size;
      this.loadCarOrderMessage();
    },
    //当页数改变时
    handleCurrentChange(currentPage) {
      this.query.pageIndex = currentPage;
      this.loadCarOrderMessage();
    },
    loadCarOrderMessage() {
      this.$axios.post("car/queryAllCarOrderMessage", this.query).then((res) => {
        this.carMessageList = res.data.data.list;
        this.pageInfo.pages = res.data.data.pages;
        this.pageInfo.total = res.data.data.total;
      });
    },

    


  },
  mounted() {
    this.loadCarOrderMessage();
  },
};
</script>

<style scoped>
</style>